home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / win / rtfhelp.zip / SAMPLE.HDC < prev    next >
Text File  |  1994-11-06  |  10KB  |  266 lines

  1. * J. Hlavaty, RTFHelp sample file
  2. * defaults for the file go here
  3.   DEFFONT 0
  4.   FONTSIZE 24
  5. *   Justified text, with a 1/2" left and 1/2" right margin (1440 twips per inch)
  6.   LEFTINDENT 720
  7.   RIGHTINDENT 720
  8. * Now begin the first topic
  9. * The TITLE tag introduces a topic (page) of a help file.
  10.   TITLE The first topic is usually the TABLE OF CONTENTS for the help file
  11. *   The following statements select 12 point TmsRmn out of RTFHelp's default
  12. *     font table.  What we'll actually get depends on the available fonts
  13. *     in the session of Windows in which the help file is executing.
  14. *   As noted in the text, measurements for tags like LEFTINDENT are in TWIPs
  15. *      (an abbreviation for twentieths of a point).  To convert inches to twips,
  16. *      simply multiple inches by 1440 (72 points in an inch times twenty).
  17. *      Other tags, like FONTSIZE are in 1/2 points so FONTSIZE 72 is 36 point
  18. *      (meaning 1/2") type.  Note that LEFTINDENT (twips) tag arguments are
  19. *      ten times the equivalent FONTSIZE argument
  20.   KEYWORD Table of Contents
  21.  
  22. * note that if you wish your pop-up topics or links to be each on
  23. *   an individual line, then you must use PARA tags to force the separation.
  24. *   Don't forget the last PARA tag, or the text following these definitions
  25. *   will begin on the same line as the last one
  26.   BROWSESEQ rtfhelp:005
  27. * Add a sixteenth of an inch (90 twips) of whitespace after each of the following
  28. *   definitions for readability
  29.   SA 90
  30.   PARA
  31.    PUTPOPUP rtfhbann.c
  32.   XREFID PTR_RTFHBANN_C
  33.   PARA
  34.    PUTPOPUP rtfhcp85.c
  35.   XREFID PTR_RTFHCP85_C
  36.   PARA
  37.    PUTPOPUP rtfhdata.c
  38.   XREFID PTR_RTFHDATA_C
  39.   PARA
  40.    PUTPOPUP rtfhhelp.c
  41.   XREFID PTR_RTFHHELP_C
  42.    PUTPOPUP rtfhmain.c
  43.   XREFID PTR_RTFHMAIN_C
  44.   PARA
  45.    PUTPOPUP rtfhpars.c
  46.   XREFID PTR_RTFHPARS_C
  47.  
  48. * Without the following PARA, the following text would be right next to the RTFHHELP.C
  49. *    PUTPOPUP
  50. * Switch to a smaller font
  51. FONTSIZE 16
  52. PARA
  53.    Please select one of the terms above by single-clicking on it with the
  54.  left mouse button to view its definition, or go to a topic below by clicking on it.
  55.  
  56. PARA
  57. FONTSIZE 24
  58. * The PUTLINK tag tells the user where the link will go
  59.   PUTLINK   Margins and spacing
  60. * The XREFID tag must also be used to tell the help compiler what DEFINELINK
  61. *   to go to
  62.   XREFID LINKTO_MARGINSANDSPACING
  63.   PARA
  64.   PUTLINK   Special Effects
  65.   XREFID LINKTO_SPECIALEFFECTS
  66.   PARA
  67.   PUTLINK   Bitmaps and graphics
  68.   XREFID LINKTO_BITMAPSANDGRAPHICS
  69.   PARA
  70.   PUTLINK   WinHelp Terms
  71.   XREFID LINKTO_WINHELPTERMS
  72.   PARA
  73.   PUTLINK   RTFHelp Terms
  74.   XREFID LINKTO_RTFHELPTERMS
  75.  
  76. * Now explicitly start a new topic (PAGE) with the PAGE tag, which has no
  77. *   arguments.  The PAGE tag ends the current page.
  78. *   The help compiler will not like an extra \page tag on the first
  79. *   page.  It will assume that the blank page is the table of contents
  80. *   if you do not have a CONTENTS tag in your HPJ file
  81.   PAGE
  82.   TITLE Text formatting in a help file
  83.   KEYWORD text formatting; left indent; right indent; hanging indent; default paragraph settings
  84.   BROWSESEQ rtfhelp:010
  85.   DEFINELINK LINKTO_MARGINSANDSPACING
  86. * now reset the spacing after each PARA to the default
  87. * 90= 1/16th inch glue following each PARA
  88.   SA 90
  89.   JUST
  90.   LEFTINDENT 0
  91.   RIGHTINDENT 2880
  92. This is text with a two inch right margin.  This is just done for some contrast with the paragraph below.
  93.  
  94.   PARA
  95. * This produces a "hanging" indent for the first line only.  Note the negative offset
  96. *      The actual value used for the first line's offset is LEFTINDENT+FIRSTINDENT
  97.   FIRSTINDENT -720
  98.   LEFTINDENT 720
  99.   RIGHTINDENT 720
  100.  
  101. this is text with a "hanging" indent, as you'll see the rest (lines after
  102.  the first) of this paragraph is indented normally.
  103. PARA
  104.   SA 720
  105. * Reset the firstindent/leftindent values to the default (720 ? )
  106.   FIRSTINDENT
  107.   LEFTINDENT
  108. This paragraph has one/half inch of "glue" (empty space) following.  Notice that
  109.  the indent of the first and second lines are identical.
  110.   PARA
  111.   SA 0
  112. This paragraph has no glue following
  113.   PARA
  114.   PARD
  115.   This is a paragraph using default paragraph settings
  116.   PARA
  117.  
  118.  
  119.   PAGE
  120.   TITLE Text formatting in a help file, continued
  121.   KEYWORD text formatting; italic; smallcaps; bold
  122.   BROWSESEQ rtfhelp:015
  123.   DEFINELINK LINKTO_SPECIALEFFECTS
  124. * now reset the spacing after each PARA to the default
  125.   SA
  126.   LEFTINDENT 720
  127.   RIGHTINDENT 720
  128. ITALIC This is italic text with half-inch left and right margins and this should
  129. ITALIC %also appear as Justified Text if the JUST tag is supported by the help compiler.
  130. * JUST
  131. PARA
  132.   LEFTINDENT 2880
  133.   RIGHTINDENT 0
  134. * note that RTFHelp considers the end of a line to end certain tags.  This is
  135. *   intentional so that certain formatting properties (bold, italic and so
  136. *   forth do not span lines)
  137. JUST
  138. LEFTINDENT 1440
  139. SMALLCAPS This is text with a one inch left margin in small caps.
  140. *   Note the use of the hard space character (%) to force a space.
  141. SMALLCAPS %flexibility that you can put in your help file.  Notice how smallcaps seem to draw your eyes.
  142.   PARA
  143. * Reset leftindent to default
  144. LEFTINDENT
  145. BOLD   This text is displayed in bold type.  Bold is another method of highlighting
  146. BOLD   %text (similar to underlining).  Note that underlining is not supported by
  147. BOLD   %RTFHelp as the help compiler gives a specific meaning to the RTF underline
  148. BOLD   %command in help files.
  149. PARA
  150.   PAGE
  151.   TITLE Bitmaps and graphics
  152.   KEYWORD bitmap; graphics
  153.   BROWSESEQ rtfhelp:020
  154.   DEFINELINK LINKTO_BITMAPSANDGRAPHICS
  155. *
  156. * You will need to copy pyramid.bmp from your \windows directory to the
  157. *   directory containing your HDC file for the bitmap to be found
  158. *
  159.   BMC pyramid.bmp
  160.   This is a sample bitmap caption
  161.  
  162. SA 180
  163. * begin a new paragraph and draw a box around it
  164. PARA
  165.   BOX
  166.   DEFTAB 2880
  167.   TAB
  168. 1
  169.   TAB
  170. This is one
  171.   LINE
  172.   TAB
  173. 2
  174.   TAB
  175. This is two
  176. PARA
  177. PARD
  178.  
  179.  PAGE
  180.   TITLE WinHelp Terminology
  181.   BROWSESEQ rtfhelp:025
  182. * note that a ; separates multiple keywords (as multiword keywords are permitted)
  183. * you can also have multiple KEYWORDs in the same topic
  184.   KEYWORD     WinHelp terminology
  185.   KEYWORD     topic file; topic; title; link; pop-up topic
  186.   DEFINELINK LINKTO_WINHELPTERMS
  187.   SA 90
  188. The document containing the Rich Text Format (hereafter abbreviated RTF) text
  189.  input to the help compiler will be called the TOPIC FILE.  One or more topic
  190.  files are used to generate a help file (a binary file with the .HLP
  191.  extension). Every topic file is made up of a series of "pages" or "screens"
  192.  of related information known as TOPICS.
  193. PARA
  194. Each topic can contain a variety of constructs, such as titles,
  195.  links and pop-up topics.  A TITLE is not visible in the topic itself, but is
  196.  used in the Search and other WinHelp dialog boxes to allow the user to
  197.  distinguish this topic from others in the help file.
  198. PARA
  199.  A LINK hooks one topic
  200.  to another so that when the user clicks on the link's hot spot, the topic
  201.  that the link references will become the current topic displayed to the user.
  202. PARA
  203. Finally, a POP-UP TOPIC when clicked on will create a child window on top of
  204.  the help  window which contains information for the user.  These pop-up topics
  205.  are often used for definitions of terms.
  206.  
  207.  
  208.  PAGE
  209.   TITLE RTF Terminology
  210.   BROWSESEQ rtfhelp:030
  211.  * note that a ; separates multiple keywords (as multiword keywords are permitted)
  212.  * you can also have multiple KEYWORDs in the same topic
  213.   KEYWORD     RTFHelp terminology
  214.   KEYWORD     control words; control symbols; groups
  215.   DEFINELINK LINKTO_RTFHELPTERMS
  216. The topic file is a collection of RTF tags and raw text.  These tags
  217.  are known as CONTROL WORDS and all contain a backslash as their first
  218.  character and consist of entirely lower case letters (RTF is case-sensitive).
  219.  One such tag is \\par to end a paragraph.
  220. PARA
  221. There is a small set of non-alphabetic control words known as CONTROL
  222.  SYMBOLS, such as \\~ which signifies a hard (non-breaking) space.
  223. PARA
  224. Control words and control symbols together with the text making up the
  225.  topic file are collected in GROUPS.  A group begins with an open curly brace
  226.  and continues until an equally-nested closing curly brace.  Any formatting
  227.  properties that are found within a group apply to all and only elements of
  228.  that group. Some groups can even inherit specific formatting properties from
  229.  the group preceding them.  For details on exactly when and how this occurs,
  230.  refer to the RTF specification listed in the reference section.
  231. PARA
  232. RTFHelp uses the tagged file passed in by the user to generate an
  233.  RTF topic file containing a mixture of control words, control symbols and
  234.  groups.
  235.  
  236.   PAGE
  237. * Here are the definitions for our (what's the term) definitions
  238.  
  239. * A few warnings are in order.  The DEFINEPOPUP generates a new page, so I
  240. *   generally put my DEFINEPOPUPs at the end of my help file.
  241. * Note that the context ID (such as PTR_RTFHMAIN_C below) cannot have any
  242. *   text following it.  This is because RTF assumes that any text following
  243. *   the context ID is actually a part of the context ID and includes it in
  244. *   the #{\footnote} tag that it builds.  The help compiler will complain
  245. *   about this mixture of text and context ID.
  246. *   Because of this, there is a restriction that text that is the definition
  247. *   of a DEFINEPOPUP must begin on the line following the DEFINEPOPUP tag and ID
  248.   DEFINEPOPUP PTR_RTFHMAIN_C
  249.     RTFHMain.c is the main module for RTFHelp.  It reads the tagged input file, and writes
  250.  the formatted RTF text to the output file.
  251.   DEFINEPOPUP PTR_RTFHCP85_C
  252.     RTFHCP85.c is the module containing the translation table from CP850 (the so-called
  253.  Latin 1 code page).  This code page roughly corresponds to those characters needed to
  254.  display Western European languages.  It converts to the Windows default (ANSI) code page.
  255.   DEFINEPOPUP PTR_RTFHDATA_C
  256.     RTFHData.c is the module containing global data.
  257.   DEFINEPOPUP PTR_RTFHBANN_C
  258.     RTFHBann.c is the module containing the banner (logo) information
  259.  that is displayed when using the RTFHelp compiler.
  260.   DEFINEPOPUP PTR_RTFHHELP_C
  261.     RTFHHelp is the module that processes RTFHelp's command line arguments.
  262.   Named because it also displays help for the user.
  263.   DEFINEPOPUP PTR_RTFHPARS_C
  264.     RTFHHelp is the module that contains the RTFHelp parser.
  265.  
  266.